package models.test;

import org.apache.commons.lang.StringUtils;
import play.modules.siena.EnhancedModel;
import siena.Generator;
import siena.Id;
import siena.core.Aggregated;
import siena.core.Many;

public class Contact extends EnhancedModel {
    @Id(Generator.AUTO_INCREMENT)
    public Long id;

    public  String name;

    @Aggregated
    public  Many<Contact> relatedsContact;
    
    public String relatedString() {
        return "[" + StringUtils.join(relatedsContact.asList().toArray(), ",") + "]";
    }
    
    public String toString() {
        return id + "|" + name;
    }
}
